package com.atstudy.headline.web.app.service.impl;

import com.atstudy.headline.entity.Categories;

import com.atstudy.headline.web.app.mapper.CategoriesMapper;
import com.atstudy.headline.web.app.service.CategoriesService;
import com.atstudy.headline.web.app.vo.categories.CategoryVO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author A
* @description 针对表【categories(内容分类表)】的数据库操作Service实现
* @createDate 2025-06-12 13:55:56
*/
@Service
public class CategoriesServiceImpl extends ServiceImpl<CategoriesMapper, Categories>
    implements CategoriesService {

    @Autowired
    private CategoriesMapper categoriesMapper;
    public List<CategoryVO> getActiveCategoriesWithCount() {
        return baseMapper.selectActiveCategoriesWithCount();
    }

    @Override
    public List<Map<String, Object>> getCategoryContentCounts() {
        return categoriesMapper.getCategoryContentCounts();
    }
}




